﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Northwind.NET.FE.zzzSamples
{
    public partial class ListOrdersReport : Form
    {
        public ListOrdersReport()
        {
            InitializeComponent();
        }

        private void ListOrdersReport_Load(object sender, EventArgs e)
        {
            int? orderId = null;
            this.listOrdersTableAdapter.Fill(
                this.simpleReportsDataSet.ListOrders, orderId);    
            
            this.reportViewer1.RefreshReport();
        }

        private void previewReportButton_Click(object sender, EventArgs e)
        {
            int? orderId = null;
            if (!string.IsNullOrEmpty(orderIdTextBox.Text))
            {
                orderId = Int32.Parse(orderIdTextBox.Text);
            }
            this.listOrdersTableAdapter.Fill(
            this.simpleReportsDataSet.ListOrders, orderId);
            this.reportViewer1.RefreshReport();

        }

    }
}
